#pragma once

#include "common/Types.h"
#include <winsock.h>

namespace phynet{
namespace net{

struct Address
{
	sockaddr_in m_addr;
};

inline bool operator==(const Address& i_first, const Address& i_second)
{
	return 
		i_first.m_addr.sin_family == i_second.m_addr.sin_family
		&&
		i_first.m_addr.sin_port == i_second.m_addr.sin_port
		&&
		i_first.m_addr.sin_addr.S_un.S_addr == i_second.m_addr.sin_addr.S_un.S_addr;
}

enum NetChannelType
{
	Unreliable, //not in sequence, not guaranteed (UDP)
	Sequential, //in sequence, not guaranteed
	Reliable, //not in sequence, guaranteed
	Ordered //in sequence, guaranteed (TCP)
};

enum ETransportStatus
{
	StatusOpen,
	StatusClosed,
	StatusClosing,
};

const int MAX_BITSTREAM_BYTES = 1024;

typedef SOCKET SocketType;

}} //namespace net